package behavior.strategy;

import java.math.BigDecimal;

/**
 * @author lzp
 * @Date:2023/3/7
 * @description: 满减策略
 */
public class OverDiscountStrategy implements DiscountStrategy {
	public BigDecimal getDiscount(BigDecimal total) {
		// 满100减20优惠:
		return total.compareTo(BigDecimal.valueOf(100)) >= 0 ? BigDecimal.valueOf(20) : BigDecimal.ZERO;
	}
}